import 'package:flutter/material.dart';

class DrawerPage extends StatefulWidget {
  @override
  _DrawerPageState createState() => new _DrawerPageState();
}

class _DrawerPageState extends State<DrawerPage> {

  @override
  Widget build(BuildContext context) {

    final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey();

    return Scaffold(
      key: _scaffoldKey,
      bottomNavigationBar: BackButton(),
      appBar: AppBar(
        title: Text("Drawer"),
      ),
      drawer: Drawer(
        child: Text("Drawer"),
      ),
      endDrawer: Drawer(
        child: Text("EndDrawer"),
      ),
      body: Container(
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: <Widget>[
            IconButton(
              icon: Icon(Icons.arrow_forward_ios),
              onPressed: () => _scaffoldKey.currentState.openDrawer(),
            ),
            IconButton(
              icon: Icon(Icons.arrow_back_ios),
              onPressed: () => _scaffoldKey.currentState.openEndDrawer(),
            ),
          ],
        ),
      ),
    );
  }
}
